from config import file_url_config, query_params_config

# 登陆网址
login_url = 'http://szsl.yiweimenggdtc.com/wms/login.jsp;jsessionid=0E3FC1BF4610D01DB2FE73A6836724BA?state=login'
# 用户名
username = '26002'
# 密码
password = 'zzfj888'

# 查询的日期
yesterday = query_params_config.yesterday
nowDay = query_params_config.nowDay
# 查询开始时间
query_start_time = query_params_config.query_start_time
# 查询结束时间
query_end_time = query_params_config.query_end_time

id_prefix = 'shanlian'
data_source = '众志--闪链配送'

selenium_file_prefix = f'{file_url_config.download_selenium_excel_file_prefix_url}\\{nowDay}'
clean_file_prefix = f'{file_url_config.download_excel_file_prefix_url}\\{nowDay}'

# 下载好之后保存的文件名
shanlian_excel_name = '闪链销售数据.xls'
selenium_excel_file_url = f'{selenium_file_prefix}\\{shanlian_excel_name}'
shanlian_error_file_url = f'{selenium_file_prefix}\\闪链销售数据导出失败.txt'
excel_file_url = f'{clean_file_prefix}\\{shanlian_excel_name}x'

# 自动话测试点击的元素信息
login_element_list = [
    # 0.点击登陆
    '/html/body/div[2]/div[1]/a',
    # 1.点击ERP销存管理
    '/html/body/div[2]/div[1]/ul/li[1]/div/p',
    # 2.点击账号框输入账号然后输入账号 By.XPATH
    '//*[@id="j_username"]',
    # 3.点击密码框输入账号
    '//*[@id="j_password"]',
    # 4.定位验证码图片元素
    '//*[@id="ext-gen63"]/img',
    # 5.输入验证码
    '//*[@id="j_captcha"]',
    # 6.点击登陆
    '//*[@id="loginbtn"]/tbody/tr[2]/td[2]',
]
# 登陆成功获取数据
get_data_element_list = [
    # 0.点击左边显示GSP报表 By.XPATH
    {
        'XPATH': '//*[@id="ext-gen179"]',
        'type': 'click',
        'sleep': 5
    },
    # 1.点击销售记录查询 By.XPATH
    {
        'XPATH': '//*[@id="ext-gen184"]/div/li[10]/div/a',
        'type': 'click',
        'sleep': 5,
        'switchFrame': 1,
    },
    # 2.点击显示全部 By.XPATH
    {
        'XPATH': '/html/body/div[1]/div/div/div/div[2]/div[1]/div/table/tbody/tr/td[1]/table/tbody/tr/td[1]/table/tbody/tr[2]/td[2]/em/button',
        'type': 'click',
        'sleep': 2
    },
    # 3.点击导出 By.XPATH
    {
        'XPATH': '/html/body/div[1]/div/div/div/div[2]/div[1]/div/table/tbody/tr/td[1]/table/tbody/tr/td[3]/table/tbody/tr[2]/td[2]/em/button',
        'type': 'click',
        'sleep': 20
    }
]




